package com.antdesignbackend.backend.service.impl;

import com.antdesignbackend.backend.entity.FactoryRecord;
import com.antdesignbackend.backend.entity.SlaughterRecord;
import com.antdesignbackend.backend.entity.entityVo.SlaughterRecordVo;
import com.antdesignbackend.backend.mapper.FactoryRecordMapper;
import com.antdesignbackend.backend.mapper.SlaughterRecordMapper;
import com.antdesignbackend.backend.service.FactoryRecordService;
import com.antdesignbackend.backend.service.SlaughterRecordService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SlaughterRecordServiceImpl extends ServiceImpl<SlaughterRecordMapper, SlaughterRecord> implements SlaughterRecordService {
    @Autowired
    SlaughterRecordMapper slaughterRecordMapper;
    @Override
    public List<SlaughterRecordVo> search(@Param(Constants.WRAPPER) QueryWrapper<SlaughterRecordVo> slaughterRecordVoQueryWrapper, Page<SlaughterRecordVo> slaughterRecordVoPage){
        return slaughterRecordMapper.search(slaughterRecordVoQueryWrapper,slaughterRecordVoPage);
    };
    public Integer count(@Param(Constants.WRAPPER) QueryWrapper<SlaughterRecordVo> slaughterRecordVoQueryWrapper){
        return slaughterRecordMapper.count(slaughterRecordVoQueryWrapper);
    };
}
